import pytest
from Day68.mengfeiyuan.example import query_data


@pytest.fixture()
def connection():
    print("连接成功")
    yield "x"
    print("连接关闭")

def test_pass(connection):
    query_data(connection, "select * from db")

def test_fail1(connection):
    query_data(connection, "")

def test_fail2(connection):
    query_data(None, "select * from db")



if __name__ == '__main__':
    pytest.main(['-s', 'mengfeiyuan.py'])